import requests

headers = {
    'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36',
    'Referer': 'https://www.baozimh.com/user/signin',  # 移除空格
    'Origin': 'https://www.baozimh.com',               # 移除空格
}

data = {
    'username': '2021835877@qq.com',
    'password': 'Yyl.985211',
}

session = requests.Session()
response = session.post('https://www.baozimh.com/api/bui/signin', data=data, headers=headers)

print(response.text)
print(response.status_code)

url = f'https://www.baozimh.com/user/my_bookshelf'

headers = {
    "accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7",
    "accept-encoding": "gzip, deflate, br, zstd",
    "accept-language": "zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7",
    "cache-control": "no-cache",
    "connection": "keep-alive",
    "cookie": "_ga=amp-v2UUI1ORiOcTOJXxAUrqHw; TSID=eyJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiJvVUJBUmxXNFZvN2lWbXA1RGRyMnZZbVRmUzdnRUs4ZiIsImV4cGlyZSI6MjA3Nzc5NTEzNywic3RhcnQiOjE3NjI0MzUxMzd9.k4C7YYOAjSw2Khd-ijhy-CnOWmQ1IA4XKP05G1vS7PE",
    "host": "www.baozimh.com",
    "pragma": "no-cache",
    "referer": "https://www.baozimh.com/user/my_bookshelf",
    "sec-ch-ua": "\"Google Chrome\";v=\"141\", \"Not?A_Brand\";v=\"8\", \"Chromium\";v=\"141\"",
    "sec-ch-ua-mobile": "?0",
    "sec-ch-ua-platform": "\"Windows\"",
    "sec-fetch-dest": "document",
    "sec-fetch-mode": "navigate",
    "sec-fetch-site": "same-origin",
    "sec-fetch-user": "?1",
    "upgrade-insecure-requests": "1",
    "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36"
}
response = session.get(url,headers=headers)
print(response.text)